package com.sskj.hhrt.mine;

import android.accounts.NetworkErrorException;

import com.google.gson.JsonSyntaxException;
import com.hjq.toast.ToastUtils;
import com.sskj.base.api.OtherLoginEvent;
import com.sskj.base.api.OtherLoginException;
import com.sskj.base.utils.RxUtils;
import com.sskj.hhrt.BasePresenter;
import com.sskj.hhrt.api.Api;
import com.sskj.hhrt.api.ApiObserver;
import com.sskj.hhrt.mine.data.AppVersionBean;

import org.greenrobot.eventbus.EventBus;

import java.net.SocketTimeoutException;


/**
 * @author Hey
 * Create at  2019/03/20
 */
class SettingActivityPresenter extends BasePresenter<SettingActivity> {

    public void checkVersion(String versionName) {
        Api.getInstance().checkVersion(1, versionName)
                .compose(RxUtils.transform())
                .subscribe(new ApiObserver<AppVersionBean>(this) {
                    @Override
                    public void onSuccess(AppVersionBean data) {
                        mView.checkVersion(data);
                    }

                });
    }
}
